﻿// (c) Copyright 2013 Mike Riedel.
// This source is subject to the Microsoft Public License (Ms-PL).
// All other rights reserved.

namespace FreshMeat.Threading
{
   /// <summary>
   /// Defines a lock that regulates the reading or writing of a resource by multiple threads.
   /// </summary>
   public interface IReaderWriterLock
   {
      /// <summary>
      /// Gets the lock for read access.
      /// </summary>
      /// <returns></returns>
      ILock Read();

      /// <summary>
      /// Gets the lock for write access.
      /// </summary>
      /// <returns></returns>
      ILock Write();
   }
}
